import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/login'
import Main from '@/views/main'
import UserList from '@/views/userManagement/userList'
import UserAdd from '@/views/userManagement/userAdd'
import UserEdit from '@/views/userManagement/userEdit'
import Institution from '@/views/institutionManagement/Institution'
import Filedownload from '@/views/Filedownload'
import Roles from '@/views/rolesManagement/roles'
import Permission from '@/views/permissionManagement/permission'
import Application from '@/views/applicationManagement/application'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',
      component: Login
    },
    {
      path: '/main',
      component: Main,
      children:[
        { path: '/userList', component: UserList},
        { path: '/userAdd', component: UserAdd},
        { path: '/userEdit/:id', component: UserEdit},
        { path: '/institution', component: Institution},
        { path: '/filedownload', component: Filedownload},
        { path: '/roles', component: Roles},
        { path: '/permission', component: Permission},
        { path: '/application', component: Application}
      ],
      redirect: '/userList'
    } 
  ]
})
